package com.wang.designpattern.proxy.dynamic;

import com.wang.designpattern.proxy.staticproxy.TeacherDaoProxy;

public class Client {

    public static void main(String[] args) {
        // 1、创建目标对象
        ITeacherDao target = new TeacherDao();


        // 2、创建代理对象
        ITeacherDao proxyInstance = (ITeacherDao) new ProxyFactory(target).getProxyInstance();

        // 3、class com.sun.proxy.$Proxy0
        System.out.println(proxyInstance.getClass());

        // 4、执行方法
        proxyInstance.teach();
    }
}
